package com.sxt.practiceapplication.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.Nullable;

public class TitleBar extends LinearLayout {

    private View search;

    public TitleBar(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        search = getChildAt(1);
        search.setOnClickListener(v -> {
            Toast.makeText(getContext(), "搜索", Toast.LENGTH_SHORT).show();
        });
    }

}
